import { createRouter, createWebHashHistory } from "vue-router";
import Layout from "@/views/Layout.vue";

const routes = [
  {
    path: "/",
    component: Layout,
    children: [
      {
        path: "/",
        name: "compress",
        component: () => import("@/views/Compress.vue"),
        meta: { title: "图片压缩" }
      },
      {
        path: "/watermark",
        name: "watermark",
        component: () => import("@/views/Watermark.vue"),
        meta: { title: "图片水印" }
      },
      {
        path: "/clipper",
        name: "clipper",
        component: () => import("@/views/Clipper.vue"),
        meta: { title: "图片裁剪" }
      }
    ]
  }
];

export default createRouter({
  history: createWebHashHistory(),
  scrollBehavior: () => ({ x: 0, y: 0 }),
  routes
});
